package ru.ifmo.network.skype.network;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * @author avhaliullin
 */
public class SocketChannel implements Channel {
    private final InputStream in;
    private final OutputStream out;

    public SocketChannel(InputStream in, OutputStream out) {
        this.in = in;
        this.out = out;
    }

    @Override
    public InputStream getInputStream() throws IOException {
        return in;
    }

    @Override
    public OutputStream getOutputStream() throws IOException {
        return out;
    }

    @Override
    public void close() {
        try {
            in.close();
            out.close();
        } catch (IOException e) {
        }
    }
}
